package user;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
/**
 *
 * @author Killian
 */
@Entity
@Table(name="USER_ADMIN")
class User implements java.io.Serializable {
    private static final long serialVersionUID = -8767337896773261247L;
 
    private int id_user;
    private String identifiant;
    private String password;
    private String passwordConfirm;
    private String mail;
    private Droit droit;

    public User() {
    }  
    
    public User(int id_user, String identifiant, String mail,String password){
        this.id_user = id_user;
        this.identifiant = identifiant;
        this.mail = mail;
        this.password = password;
    }
 
    @Id
    @GeneratedValue
    @Column(name="ID_USER")
    public int getId_user() {
        return id_user;
    }
    @Column(name="IDENTIFIANT")
    public String getIdentifiant() {
        return identifiant;
    }
    @Column(name="PASSWORD")
    public String getPassword() {
        return password;
    }
    @Column(name="MAIL")
    public String getMail() {
        return mail;
    }

    public void setId_user(int id_user) {
        this.id_user = id_user;
    }
    public void setIdentifiant(String identifiant) {
        this.identifiant = identifiant;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public void setMail(String mail) {
        this.mail = mail;
    }  
    
    @ManyToOne
    @JoinColumn(name="id_droit")
    public Droit getDroit() {
        return droit;
    }

    public void setDroit(Droit droit) {
        this.droit = droit;
    } 

    @Override
    public String toString() {
        return "User{" + "id_user=" + id_user + ", identifiant=" + identifiant + ", password=" + password + ", passwordConfirm=" + passwordConfirm + ", mail=" + mail + ", droit=" + droit + '}';
    }   
}